import React, { lazy } from 'react'
import { Redirect } from 'react-router-dom'

// import MSNDiscover from '@/pages/discover'
// import MSNRecommend from "@/pages/discover/c-pages/recommend";
// import MSNRanking from "@/pages/discover/c-pages/ranking";
// import MSNSongs from "@/pages/discover/c-pages/songs";
// import MSNDjradio from "@/pages/discover/c-pages/djradio";
// import MSNArtist from "@/pages/discover/c-pages/artist";
// import MSNAlbum from "@/pages/discover/c-pages/album";
// import MSNPlayer from "@/pages/player"
// import MSNMine from '@/pages/mine'
// import MSNFriend from '@/pages/friend'
const MSNDiscover = lazy(()=> import('@/pages/discover'))
const MSNRecommend = lazy(_ => import("../pages/discover/c-pages/recommend"));
const MSNRanking = lazy(_ => import("../pages/discover/c-pages/ranking"));
const MSNSongs = lazy(_ => import("../pages/discover/c-pages/songs"));
const MSNDjradio = lazy(_ => import("../pages/discover/c-pages/djradio"));
const MSNArtist = lazy(_ => import("../pages/discover/c-pages/artist"));
const MSNAlbum = lazy(_ => import("../pages/discover/c-pages/album"));
const MSNPlayer = lazy(_ => import("../pages/player"));

const MSNFriend = lazy(_ => import("../pages/friend"));
const MSNMine = lazy(_ => import("../pages/mine"));
const routes =[
  {
    path: "/",
    exact: true,
    render: () => (
      <Redirect to={"/discover"}/>
    )
  },
  {
    path: "/discover",
    component: MSNDiscover,
    routes: [
      {
        path: "/discover",
        exact: true,
        render: () => (
          <Redirect to={"/discover/recommend"}/>
        )
      },
      {
        path: "/discover/recommend",
        component: MSNRecommend
      },
      {
        path: "/discover/ranking",
        component: MSNRanking
      },
      {
        path: "/discover/songs",
        component: MSNSongs
      },
      {
        path: "/discover/djradio",
        exact: true,
        component: MSNDjradio
      },
      {
        path: "/discover/artist",
        component: MSNArtist
      },
      {
        path: "/discover/album",
        component: MSNAlbum
      },
      {
        path: "/discover/player",
        component: MSNPlayer
      }
    ]
  },
  {
    path: "/mine",
    component: MSNMine,
  },
  {
    path: "/friend",
    component: MSNFriend,
  },
]

export default routes